'''
响应：
'''
import requests

url = "http://192.168.150.33:8088/futureloan/mvc/api/member/register"
cs = {"mobilephone": "18012345678", "pwd": ""}
r = requests.get(url, params=cs)
print("文本格式的响应体：", r.text)  # str
print("状态码：", r.status_code)
print("响应头：", r.headers)
print("请求头：", r.request.headers)
# {"status":0,"code":"20103","data":null,"msg":"密码不能为空"}
print("json格式的响应体转成字典：", r.json())  # 非json格式的，报错
assert r.status_code == 200
assert r.json()['status'] == 0
assert r.json()['code'] == '20103'
assert r.json()['msg'] == "密码不能为空"
assert "密码不能为空" in r.text
assert "20103" in r.text
